package labox.innovation.gameserver.model;

import labox.innovation.gameserver.model.actor.instance.FuzePcInstance;
import labox.innovation.gameserver.model.base.FriendNewsType;

public class FriendNewsFactory {
	
	
	
	/**
	 * @param player
	 * @return
	 * 创建登录消息
	 */
	public static FriendsNews creatLoginMessage(FuzePcInstance player) {
		return new FriendsNews(player, null,null, FriendNewsType.FRIENDLOGIN);
	}
	/**
	 * @param player
	 * @return
	 * 当角色升级时调用
	 */
	public static FriendsNews creatUpLeveMessage(FuzePcInstance player){
		return  new FriendsNews(player, null, null,FriendNewsType.UPLEVEL);

	}
	/**
	 * @param player
	 * @param killer
	 * 被同族的人杀害时调用
	 */
	public static FriendsNews creatDeadMessage(FuzePcInstance player,FuzePcInstance killer){
		if(player.getRace().getId()==killer.getRace().getId()){
			return new FriendsNews(player, killer, null,FriendNewsType.KILLED);
		}
		return null;
	}
	
	/**
	 * @param player
	 * @param item
	 * 物品追星时调用
	 */
	public static FriendsNews  creatDamoMessage(FuzePcInstance player,L2ItemInstance item){
		if(item!=null){
			return new FriendsNews(player, null, item,FriendNewsType.GROUPIE);
		}
		return null;
	}
	/**
	 * @param player
	 * @param friend
	 * 添加好友时调用
	 */
	public static FriendsNews  creatAddFriendsMessage(FuzePcInstance player,FuzePcInstance friend){
		return new FriendsNews(player, friend,null, FriendNewsType.ADDNEWFRIEND);
	}
	
	/**
	 * @param player
	 * @param friend
	 * 添加我好友时调用
	 */
	public static FriendsNews  creatAddMeMessage(FuzePcInstance player){
		return new FriendsNews(player, null,null, FriendNewsType.COVERFRIEND);
	}
	/**
	 * @param player
	 * 渡劫时调用
	 */
	public static FriendsNews  addDamoMessage(FuzePcInstance player){

		return new FriendsNews(player, null,null, FriendNewsType.DAMO);
	
	}
}
